#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo01.py
@time:2022/03/18
"""
import asyncio


# async def test01():
#     ...
#     print("hello")
#     await asyncio.sleep(1)
#     print("world")
import time


async def test01(delay, content):
    ...

    await asyncio.sleep(delay)
    print(content)


async def main():
    ...
    # await test01(2, "hello")
    # await test01(1, "world")
    task01 = asyncio.create_task(test01(2,"hello"))
    task02 = asyncio.create_task(test01(1,"world"))

    print(f'{time.strftime("%X")}')

    await task01
    await task02
    print(f'{time.strftime("%X")}')

if __name__ == '__main__':
    pass
    # asyncio.run(test01())
    asyncio.run(main())
